<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name="Author" content="Michael Margraf">
<title>Qucs - Schematic File Format</title>
</head>



<body>
<a name="top" id="top"></a>

<center><h3>
- Qucs -<br>
Quite Universal Circuit Simulator<br>
</h3>
<h1>
Schematic File Format<br><br>
</h1></center>

This document describes the schematic file format of Qucs.
This format is used for schematics (usually with suffix ".sch")
and for data displays (usually with suffix ".dpl").
The following text shows a short example of a schematic file.
<br><br>

<tt><small>
&#060;Qucs Schematic 0.0.6&#062; <br>
&#060;Properties&#062; <br>
  &nbsp;&nbsp;&#060;View=0,0,800,800,1,0,0&#062; <br>
&#060;/Properties&#062; <br>
&#060;Symbol&#062; <br>
  &nbsp;&nbsp;&#060;.ID -20 14 SUB&#062; <br>
&#060;/Symbol&#062; <br>
&#060;Components&#062; <br>
  &nbsp;&nbsp;&#060;R R1 1 180 150 15 -26 0 1 "50 Ohm" 1 "26.85" 0 "european" 0&#062; <br>
  &nbsp;&nbsp;&#060;GND * 1 180 180 0 0 0 0&#062; <br>
&#060;/Components&#062; <br>
&#060;Wires&#062; <br>
  &nbsp;&nbsp;&#060;180 100 180 120 "" 0 0 0 ""&#062; <br>
  &nbsp;&nbsp;&#060;120 100 180 100 "Input" 170 70 21 ""&#062; <br>
&#060;/Wires&#062; <br>
&#060;Diagrams&#062; <br>
  &nbsp;&nbsp;&#060;Polar 300 250 200 200 1 #c0c0c0 1 00 1 0 1 1 1 0 5 15 1 0 1 1 315 0 225 "" "" ""&#062; <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&#060;"acnoise2:S[2,1]" #0000ff 0 3 0 0 0&#062; <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#060;Mkr 6e+09 118 -195 3 0 0&#062; <br>
  &nbsp;&nbsp;&#060;/Polar&#062; <br>
&#060;/Diagrams&#062; <br>
&#060;Paintings&#062; <br>
  &nbsp;&nbsp;&#060;Arrow 210 320 50 -100 20 8 #000000 0 1&#062; <br>
&#060;/Paintings&#062; <br>
</small></tt>
<br><br>

The file contains several section. Each of it is explained below.
Every line consists of not more than one information block that
starts with a less-sign "&#060;" and ends with a greater-sign
"&#062;".

<br>
<h3>Properties</h3>
The first section starts with "&#060;Properties&#062;" and ends with
"&#060;/Properties&#062;". It contains the document properties of the
file. Each line is optional. The following properties are supported:
<br>
<ul>
<li><em>&#060;View=x1,y1,x2,y2,scale,xpos,ypos&#062;</em> contains
pixel position of the schematic window in the first four numbers,
its current scale and the current position of the upper left corner
(last two numbers).</li>
<li><em>&#060;Grid=x,y,on&#062;</em> contains the distance of the
grid in pixel (first two numbers) and whether grid is on (last number
1) or off (last number 0).</li>
<li><em>&#060;DataSet=name.dat&#062;</em> contains the file name of
the data set associated with this schematic.</li>
<li><em>&#060;DataDisplay=name.dpl&#062;</em> contains the file name of
the data display page associated with this schematic (or the file name
of the schematic if this document is a data display).</li>
<li><em>&#060;OpenDisplay=yes&#062;</em> contains 1 if the data display
page opens automatically after simulation, otherwise contains 0.</li>
</ul>

<br>
<h3>Symbol</h3>
This section starts with "&#060;Symbol&#062;" and ends with
"&#060;/Symbol&#062;". It contains painting elements creating a
schematic symbol for the file. This is usually only used for
schematic files that meant to be a subcircuit.

<br>
<h3>Components</h3>
This section starts with "&#060;Components&#062;" and ends with
"&#060;/Components&#062;". It contains the circuit components of the
schematic. The line format is as follows:
<br>
<em>&#060;type name active x y xtext ytext mirrorX rotate "Value1" visible "Value2" visible ...&#062;</em>
<br>
<ul>
<li>The type identifies the component, e.g. "R" for a resistor, "C" for
a capacitor.</li>
<li>The name is the unique component identifier of the schematic, e.g. "R1"
for the first resistor.</li>
<li>A "1" in the active field shows that the component is active, i.e
it is used in the simulation. A "0" shows it is inactive.</li>
<li>The next two numbers are the x and y coordinates of the component
center.</li>
<li>The next two numbers are the x and y coordinates of the upper left
corner of the component text. They are relative to the component center.</li>
<li>The next two numbers indicate the mirroring about the x axis ("1" for
mirrored, "0" for not mirrored) and the counter-clockwise rotation
(multiple of 90 degree, i.e. 0...3).</li>
<li>The next entries are the values of the component properties (in
quotation marks) followed by an 1 if the property is visible on the
schematic (otherwise 0).</li>
</ul>

<br>
<h3>Wires</h3>
This section starts with "&#060;Wires&#062;" and ends with
"&#060;/Wires&#062;". It contains the wires (electrical connection
between circuit components) and their labels and node sets. The
line format is as follows:
<br>
<em>&#060;x1 y1 x2 y2 "label" xlabel ylabel dlabel "node set"&#062;</em>
<br>
<ul>
<li>The first four numbers are the coordinates of the wire in pixels:
x coordinate of starting point, y coordinate of starting point,
x coordinate of end point and y coordinate of end point. All wires
must be either horizontal (both x coordinates equal) or vertical
(both y coordinates equal).</li>
<li>The first string in quotation marks is the label name. It is
empty if the user has not set a label on this wire.</li>
<li>The next two numbers are the x and y coordinates of the label
or zero if no label exists.</li>
<li>The next number is the distance between the wire starting point
and and the point where the label is set on the wire.</li>
<li>The last string in quotation marks is the node set of the wire,
i.e. the initial voltage at this node used by the simulation
engine to find the solution. This is empty if the user has not set
a node set for this wire.</li>
</ul>

<br>
<h3>Diagrams</h3>
This section starts with "&#060;Diagrams&#062;" and ends with
"&#060;/Diagrams&#062;". It contains the diagrams with their graphs
and their markers.
<br>
<em>&#060;x y width height grid gridcolor gridstyle log xAutoscale xmin xstep xmax
          yAutoscale ymin ystep ymax zAutoscale zmin zstep zmax xrotate yrotate zrotate
	  "xlabel" "ylabel" "zlabel"&#062;</em>
<br>
<ul>
<li>The first two numbers are x and y coordinate of lower left corner.</li>
<li>The next two numbers are width and height of diagram boundings.</li>
<li>The fifth number is 1 if grid is on and 0 if grid is off.</li>
<li>The next is grid color in 24 bit hexadecimal RGB value, e.g.
#FF0000 is red.</li>
<li>The next number determines the style of the grid.</li>
<li>The next number determines which axes have logarithmical scale.</li>
<li></li>
</ul>

<br>
<h3>Paintings</h3>
This section starts with "&#060;Paintings&#062;" and ends with
"&#060;/Paintings&#062;". It contains the paintings that are
within the schematic.

<br><br><a href="#top">back to the top</a><br>
</body>
</html>
